-- GENERATED SPELL FOR [Captain Galvangar] --


function spell0_11947(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(15284,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11947', 613, 1)
end

function spell1_11947(pUnit, Event) --@Frightening Shout,n/a--
pUnit:FullCastSpellOnTarget(19134,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11947', 6296, 1)
end

function spell2_11947(pUnit, Event) --@Mortal Strike,n/a--
pUnit:FullCastSpellOnTarget(16856,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11947', 5284, 1)
end

function spell3_11947(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(15589,pUnit)
pUnit:RegisterEvent('Sorts_11947', 509, 1)
end

function spell4_11947(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(13736,pUnit)
pUnit:RegisterEvent('Sorts_11947', 2000, 1)
end

function Sorts_11947(pUnit, Event)
local choix_sorts_11947 = math.random(0, 4)
if choix_sorts_11947 == 0 then
pUnit:RegisterEvent('spell0_11947', 1, 1)
end
if choix_sorts_11947 == 1 then
pUnit:RegisterEvent('spell1_11947', 1, 1)
end
if choix_sorts_11947 == 2 then
pUnit:RegisterEvent('spell2_11947', 1, 1)
end
if choix_sorts_11947 == 3 then
pUnit:RegisterEvent('spell3_11947', 1, 1)
end
if choix_sorts_11947 == 4 then
pUnit:RegisterEvent('spell4_11947', 1, 1)
end
end

function mob11947_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_11947', math.random(1500, 3000), 1)
end

function mob11947_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11947_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11947_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(11947, 1, 'mob11947_Action')
RegisterUnitEvent(11947, 2, 'mob11947_Leave')
RegisterUnitEvent(11947, 3, 'mob11947_Kill')
RegisterUnitEvent(11947, 4, 'mob11947_Die')
